package cn.iocoder.yudao.module.api.ad.effect.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 广告效果类型
 *
 * @author 山野羡民
 */
@RequiredArgsConstructor
@Getter
public enum AdEffectTypeEnum implements EnumValuable {

    UNKNOWN(0, "未知"),
    EXPOSURE(1, "曝光"),
    CLICK(2, "点击"),
    //BROWSE(10, "浏览"),
    //PLAY(11, "播放"),
    //DOWNLOAD(12, "下载"),
    TASK_SUBMIT(100, "任务提交"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

    @Override
    public String toString() {
        return new ViewObject(value, name).toString();
    }

    public static AdEffectTypeEnum valueOf(Integer value) {
        for (AdEffectTypeEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return UNKNOWN;
    }

}
